import request from '@/utils/request'

// 查询会话列表
export function listConversation(query) {
  return request({
    url: '/api/conversation/list',
    method: 'get',
    params: query
  })
}

// 查询会话详细
export function getConversation(conversationId) {
  return request({
    url: '/api/conversation/' + conversationId,
    method: 'get'
  })
}

// 新增会话
export function addConversation(data) {
  return request({
    url: '/api/conversation/create',
    method: 'post',
    data: data
  })
}

// 修改会话标题
export function updateConversationTitle(conversationId, title) {
  return request({
    url: `/api/conversation/${conversationId}/title`,
    method: 'put',
    params: { title }
  })
}

// 删除会话（逻辑删除）
export function delConversation(conversationId) {
  return request({
    url: '/api/conversation/' + conversationId,
    method: 'delete'
  })
}

// 恢复已删除的会话
export function restoreConversation(conversationId) {
  return request({
    url: `/api/conversation/${conversationId}/restore`,
    method: 'put'
  })
} 